Merge branch 'master' of github.com:cantino/huginn

Dean Putney 10 years ago
parent
commit
6073fb2a92

+ 2 - 2
deployment/site-cookbooks/huginn_production/files/default/env.example

@@ -72,8 +72,8 @@ AGENT_LOG_LENGTH=200
72 72
 #############################
73 73
 
74 74
 # AWS Credentials for MTurk
75
-AWS_ACCESS_KEY_ID="your aws access key id"
76
-AWS_ACCESS_KEY="your aws access key"
75
+AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY-ID
76
+AWS_ACCESS_KEY=YOUR-AWS-ACCESS-KEY
77 77
 
78 78
 # Set AWS_SANDBOX to true if you're developing Huginn code.
79 79
 AWS_SANDBOX=false

+ 14 - 0
spec/controllers/agents_controller_spec.rb

@@ -292,5 +292,19 @@ describe AgentsController do
292 292
         delete :destroy, :id => agents(:jane_website_agent).to_param
293 293
       }.should raise_error(ActiveRecord::RecordNotFound)
294 294
     end
295
+
296
+    it "redirects correctly when the Agent is deleted from the Agent itself" do
297
+      sign_in users(:bob)
298
+
299
+      delete :destroy, :id => agents(:bob_website_agent).to_param
300
+      response.should redirect_to agents_path
301
+    end
302
+
303
+    it "redirects correctly when the Agent is deleted from a Scenario" do
304
+      sign_in users(:bob)
305
+
306
+      delete :destroy, :id => agents(:bob_weather_agent).to_param, :return => scenario_path(scenarios(:bob_weather)).to_param
307
+      response.should redirect_to scenario_path(scenarios(:bob_weather))
308
+    end
295 309
   end
296 310
 end